<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>欢迎</title>
	<%
		pageContext.setAttribute("APP_PATH",request.getContextPath());
	%>
	<link href="static/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
	<div class="container">
		<div class="row"> 
			<div class="col-md-12 col-md-offset-4"><h1>员工信息显示</h1></div>
		</div>
		<div class="row">
			<div  class="col-md-4 col-md-offset-9">
				<button class="btn btn-info">新增</button>
				<button class="btn btn-danger">删除</button>
			</div>
		</div>
		<div class="row">
		
				<table class="table table-hover table-striped" align="center">
					  <tr align="center">
					  	<td>编号</td> <td>姓名</td> <td>性别</td> <td>邮箱</td> <td>部门</td> <td>操作</td>
					  </tr>
					  <c:forEach items="${pageInfo.list}" var="emp">
						  <tr align="center">
						  	<td>${emp.empId}</td>
						  	<td>${emp.empName}</td>
						  	<td>${emp.gender=="M"?"男":"女"}</td>
						  	<td>${emp.email}</td>
						  	<td>${emp.department.deptName}</td>
						  	<td>
						  	  <button  class="btn btn-info btn-sm">
						  		 <span class="glyphicon glyphicon-pencil" aria-hidden="true"/>编辑
						  	  </button>
	  							 
	  						  <button  class="btn btn-danger btn-sm">
	  							 <span class="glyphicon glyphicon-trash " aria-hidden="true"/>删除
	  					      </button>
						  	</td>
				  		 </tr>
			  		</c:forEach>
			  </table>
		</div>
		<div class=" col-md-offset-6">
			<nav aria-label="Page navigation">
			  <ul class="pagination">
			   	<li><a href="${APP_PATH}/emps?pn=1">首页</a></li>
			    <li>
			   
			    	<c:if test="${pageInfo.hasPreviousPage }">
			    	  <a href="${APP_PATH}/emps?pn=${pageInfo.pageNum-1 }" aria-label="Previous">
			        	<span aria-hidden="true">&laquo;</span>
			     	  </a>
			     	</c:if>
			    </li>
			    <c:forEach items="${pageInfo.navigatepageNums }" var="page_num">
			    	<c:if test="${page_num==pageInfo.pageNum }">
			    		<li class="active"><a href="${APP_PATH}/emps?pn=${page_num}">${page_num}</a></li>
			    	</c:if>
			    	<c:if test="${page_num!=pageInfo.pageNum }">
			    		<li class="disabled"><a href="${APP_PATH}/emps?pn=${page_num}">${page_num}</a></li>
			    	</c:if>
			    </c:forEach>
			    <li>
			    	<c:if test="${pageInfo.hasNextPage }">
				      <a href="${APP_PATH}/emps?pn=${pageInfo.pageNum+1 }" aria-label="Next">
				        <span aria-hidden="true">&raquo;</span>
				      </a>
				    </c:if>  
				</li>
			    <li><a href="${APP_PATH}/emps?pn=${pageInfo.pages }">末页</a></li>
			  </ul>
			</nav>
		</div>
	</div>
	<script type="text/javascript" src="static/js/jquery-1.12.4.min.js"></script>
	<script type="text/javascript" src="static/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
</body>
</html>